The present invention relates generally to a syntax analysis method in a programming language processing system, and more specifically to a language processing system utilizing this method.
In typical syntax analysis, processing is conducted in a compiler, or the like. Analysis processing in such systems is not ended, even at a point of time when a syntax error contained in an inputted program is detected. Error recovery processing, such as skipping over some extent of the program or inserting appropriate words or phrases in the program, is executed in accordance with the situation of occurrence of the syntax error, so as to continue the analysis processing. This technique is exemplified in Computer Language, Vol. 9, No. 1 (1984), pp. 51 to 67.
In conventional methods including this technique, a language syntax rule forms a basis for determining a type of recovery processing to be conducted. A word or phrase that is expected to appear dictates what syntax element should be supplemented to continue an analysis, when any syntax error is detected.
In the above-described conventional techniques, no consideration is given to the way of giving an indentation (called indention or stepping as well) to the program on the occasion when a method of error recovery is determined.
Free format programming languages allow for the start of a new paragraphs or the insertion of spaces to be freely made between words or phrases. A programmer is often left with the decision as to which indentation should be applied to a given program. The programmer decides where new paragraphs should be started and spacing for commencement of new line (how much the line is indented), for the purpose of improving the easiness-to-read of the program (although no rule is stipulated for these matters in the syntax). An example of this rule is found in structured or block-type languages such as Pascal, LISP, or PROLOG. In Pascal, for example, "begin" and "end" represent a beginning and the end of a block, respectively. A sequence of statements belonging to such a block are written with the same indentation. Any block nested deeper is typically indented further to the right (an indent is increased).
The present invention provides an improved system of accomplishing compilation or execution of software notwithstanding a presence of coding errors. The invention recognizes that spacing and indention of program source code, which provides useful information to human programmers for understanding program structure and flow, may also be seized upon as a source of information with which program debugging may be accomplished by a processor.
Accordingly, the subject invention provides an improved compiler, interpreter, or processor which can correctly compile, correct, or execute code which was heretofore required the expenditure of additional manhours. A software creation system is therefore provided which has increased reliability, lower cost, and increased throughput.